1 Set fso
= CreateObject("Scripting.FileSystemObject")
2 Set shell
= CreateObject("WScript.Shell")
4 Const TemporaryFolder
= 2
5 linkfile
= fso
.BuildPath(fso
.GetSpecialFolder(TemporaryFolder
), "Git Bash.lnk")
6 gitdir
= fso
.GetParentFolderName(WScript
.ScriptFullName
)
8 ' Dynamically create a shortcut with the current directory as the working directory.
9 Set link
= shell
.CreateShortcut(linkfile
)
10 link
.TargetPath
= fso
.BuildPath(gitdir
, "bin\sh.exe")
11 link
.Arguments
= "--login -i"
12 link
.IconLocation
= fso
.BuildPath(gitdir
, "etc\git.ico")
13 If WScript
.Arguments
.Length
> 0 Then link
.WorkingDirectory
= WScript
.Arguments(0)
16 Set app
= CreateObject("Shell.Application")
17 app
.ShellExecute linkfile